# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ResourcePool do
  @moduledoc """
  Represents the spec of a group of resources of the same type, for example machine type, disk, and accelerators, in a PersistentResource.

  ## Attributes

  *   `autoscalingSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ResourcePoolAutoscalingSpec.t`, *default:* `nil`) - Optional. Optional spec to configure GKE or Ray-on-Vertex autoscaling
  *   `diskSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DiskSpec.t`, *default:* `nil`) - Optional. Disk spec for the machine in this node pool.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Immutable. The unique ID in a PersistentResource for referring to this resource pool. User can specify it if necessary. Otherwise, it's generated automatically.
  *   `machineSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MachineSpec.t`, *default:* `nil`) - Required. Immutable. The specification of a single machine.
  *   `replicaCount` (*type:* `String.t`, *default:* `nil`) - Optional. The total number of machines to use for this resource pool.
  *   `usedReplicaCount` (*type:* `String.t`, *default:* `nil`) - Output only. The number of machines currently in use by training jobs for this resource pool. Will replace idle_replica_count.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :autoscalingSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ResourcePoolAutoscalingSpec.t()
            | nil,
          :diskSpec => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DiskSpec.t() | nil,
          :id => String.t() | nil,
          :machineSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MachineSpec.t() | nil,
          :replicaCount => String.t() | nil,
          :usedReplicaCount => String.t() | nil
        }

  field(:autoscalingSpec,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ResourcePoolAutoscalingSpec
  )

  field(:diskSpec, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DiskSpec)
  field(:id)
  field(:machineSpec, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MachineSpec)
  field(:replicaCount)
  field(:usedReplicaCount)
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ResourcePool do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ResourcePool.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ResourcePool do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
